{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "c8d01073-09a8-4c68-b93b-aef463738bd0",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "import os, sys, glob, argparse\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from tqdm import tqdm\n",
    "\n",
    "import cv2\n",
    "from PIL import Image\n",
    "from sklearn.model_selection import train_test_split, StratifiedKFold, KFold\n",
    "\n",
    "import torch\n",
    "torch.manual_seed(0)\n",
    "torch.backends.cudnn.deterministic = False\n",
    "torch.backends.cudnn.benchmark = True\n",
    "\n",
    "import torchvision.models as models\n",
    "import torchvision.transforms as transforms\n",
    "import torchvision.datasets as datasets\n",
    "import torch.nn as nn\n",
    "import torch.nn.functional as F\n",
    "import torch.optim as optim\n",
    "from torch.autograd import Variable\n",
    "from torch.utils.data.dataset import Dataset\n",
    "\n",
    "# Check if GPU is available\n",
    "if torch.cuda.is_available():\n",
    "    device = torch.device(\"cuda\")\n",
    "else:\n",
    "    device = torch.device(\"cpu\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "70d2263d-916c-431e-aca7-3e5bcd867f9b",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "train_path = glob.glob('./鸟类品种识别挑战赛训练集/training_set/*/*')\n",
    "np.random.shuffle(train_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "46d68b4a-10c8-49f3-a71e-e52c86fe2bae",
   "metadata": {
    "scrolled": true,
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['./鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML126048471.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML403566341.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML513516761.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML509386231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML205206131.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML77282711.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML398037261.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML398283661.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML117344941.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML226730091.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML152090321.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML253510981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML415395171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML98750141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML218388861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML176733751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML446184901.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML341059091.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML506881461.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML131714991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML341122231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML126549181.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML290376521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML197462681.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML253509451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML457715281.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML395048711.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML175049941.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML291830801.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML76854461.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML137114231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML451912861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML269699911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML131496791.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML509974661.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML204957151.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML198836141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML512065141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML167257161.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML284413931.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML231004751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML198223751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML192599401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML234772271.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML461778521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML139566611.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML218996391.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML350356991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML483003281.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML275969081.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML246818841.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML441560761.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML504828081.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML145709981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML294157141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML192254691.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML511491251.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML312203421.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML143843061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML493305001.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML273142481.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML247703061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML146991751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML408069081.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML138643971.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML249675721.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML386863701.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML529540551.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML459064551.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML387663551.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML147201061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML307917911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML445596481.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML295003591.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML223727121.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML296316141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML168021991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML204981301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML181022631.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML146284681.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML305554261.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML206024031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML121525881.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML209334461.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML205989341.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML270870471.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML177737361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML330208071.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML358379411.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML77611511.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML353760691.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML265570171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML283150011.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML426091911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML213509821.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML200051981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML145583821.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML200052001.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML156401831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML157483071.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML312260751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML321135841.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML182868441.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML80663671.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML410407941.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML508417751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML119799091.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML295343201.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML175202321.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML190394461.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML160198331.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML392577901.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML325728591.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML511587601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML295711581.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML204353071.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML188504421.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML205318771.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML419085261.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML204086201.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML418906021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML119391331.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML84312661.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML206232751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML368465061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML83947551.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML514806051.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML467591511.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML331978311.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML111413491.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML126349551.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML306556361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML206226911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML205685411.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML330188451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML182065591.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML523526701.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML498613151.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML301200851.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML248179271.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML193505521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML425399031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML338909131.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML90562531.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML205105511.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML108261461.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML443732761.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML171607981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML518540001.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML124994351.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML137776641.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML267482281.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML105895321.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML363930321.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML379496471.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML166366661.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML93636791.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML476002641.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML204398911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML189714751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML169951481.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML311919821.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML186110721.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML146804921.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML262351371.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML414907401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML347387871.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML215142561.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML207060991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML523840061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML206257191.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML300173011.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML175942721.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML164260481.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML148461521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML455231581.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML190830051.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML503222481.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML129254211.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML313468151.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML159735211.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML115333821.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML110936511.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML323115901.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML93424071.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML256478731.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML165949181.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML512956361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML102065951.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML196703711.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML393752971.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML205694951.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML206014051.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML288194981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML171075421.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML411892911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML204622111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML413313821.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML200017441.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML518934061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML204976381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML360074061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML527417831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML302025221.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML198831621.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML513494151.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML507987931.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML391599991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML126172311.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML518751001.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML307403551.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML361865361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML416185401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML168136281.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML151627791.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML194854181.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML515222051.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML292321831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML506926431.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML174413001.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML400293231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML190028771.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML389772341.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML199493191.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML220663201.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML436753591.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML150512521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML204757841.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML316488231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML162625601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML72905951.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML196651151.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML324313281.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML311919801.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML340774631.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML205848161.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML101448841.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML521740021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML488299541.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML238092401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML205674281.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML313469211.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML124697171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML271154791.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML268425641.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML177193671.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML204382221.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML399077241.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML534268471.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML215540781.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML185926251.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML138691241.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML351459171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML282931061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML269013061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML310042471.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML404667531.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML363834151.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML367416781.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML404667521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML448229011.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML354563391.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML267190761.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML217699391.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML401398711.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML307465101.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML511586221.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML191651441.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML430407911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML115333811.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML233304231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML116592931.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML106068951.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML171078041.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML393574231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML459081091.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML193636471.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML486909601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML205011691.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML168135941.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML99889351.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML205977621.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML320355471.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML215415391.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML401204301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML365154491.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML404825651.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML171242301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML144836761.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML388981861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML475408321.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML313439601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML520819401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML70571871.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML200383861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML206254151.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML142140801.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML490271401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML481386481.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML260545291.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML245912721.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML344883701.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML214979311.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML383208851.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML197665261.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML79417381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML238426941.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML495157501.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML530671401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML297906091.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML197349151.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML142889691.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML391917321.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML494714551.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML512965871.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML166044611.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML306633971.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML503896251.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML492817611.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML353200031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML286585111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML126675831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML513516741.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML155161081.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML258855881.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML175202291.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML114605711.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML164687411.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML342150801.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML206238071.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML246985201.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML228846561.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML506804361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML289470061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML206231111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML388196691.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML461136191.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML423517161.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML205683081.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML206129031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML353690421.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML352061521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML513330081.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML140358171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML422994601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML293921231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML218644571.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML176629401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML327579981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML171608051.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML147007941.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML325880641.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML204381011.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML372606081.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML268701141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML132617541.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML205517131.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML206187111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML284342431.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML90066931.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML497306111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML83392251.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML511160271.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML90082231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML417912751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML204569931.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML206228231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML198830191.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML205698981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML360074081.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML73646591.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML204625601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML204936161.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML89612061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML519494821.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML204653621.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML77003171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML477522891.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML353946091.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML205357661.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML172570211.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML215415251.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML384781571.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML261613981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML194714081.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML316837171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML452729621.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML204809501.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML394441471.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML190404961.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML525034361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML230854751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML93872591.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML382591281.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML175203711.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML244705741.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML476056501.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML353437251.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML314007301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML207770641.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML204497701.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML393842191.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML327439641.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML287961621.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML495140031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML133706271.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML347142751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML206045651.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML383048031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML339745201.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML209269991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML367917331.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML359797831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML464135651.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML205433701.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML164498901.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML313694061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML121394031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML143499681.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML394366211.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML335874311.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML389187541.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML457036251.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML471367921.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML399056511.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML101449691.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML477264491.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML519229181.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML124851071.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML356991281.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML404710771.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML204560231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML200267151.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML226796411.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML250498061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML278256181.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML470662481.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML183145991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML183093181.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML513276841.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML309340731.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML261147171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML218193441.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML493346721.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML241199861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML532395791.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML308932421.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML206226271.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML210245391.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML209070031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML103085111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML128000131.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML204836451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML158250431.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML96729311.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML245171391.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML97471631.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML392900231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML165136751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML138908241.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML434998371.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML306624941.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML140877481.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML482794521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML351327941.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML204806341.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML222470781.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML305081071.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML121430211.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML498753741.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML518705921.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML523806121.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML206262701.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML116481961.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML171033851.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML81257681.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML496651521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML294402591.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML335815621.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML379743021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML256095521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML385776301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML366210591.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML358183441.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML181027151.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML84171211.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML232235611.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML257060991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML314379381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML378886101.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML498247281.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML176309871.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML118628781.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML352882541.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML62997021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML495642811.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML269720231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML250503451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML352190161.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML297013361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML399992881.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML273385781.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML177877361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML376308491.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML172675261.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML299780641.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML537430371.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML208897551.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML139260141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML355203241.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML206378471.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML212651341.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML419908581.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML166591651.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML363899651.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML506047641.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML163971581.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML127793731.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML248576781.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML433453301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML139908131.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML309737881.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML396335451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML365401921.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML400675761.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML120176631.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML370051981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML376208831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML276673391.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML50900931.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML421458841.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML144142301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML204760131.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML215361691.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML436997061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML204760761.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML512399161.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML138128431.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML299086321.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML122835581.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML384252431.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML241601761.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML91833591.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML455231001.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML208955781.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML311330021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML170817711.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML204730911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML226829911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML312225111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML91250231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML215844461.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML277943801.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML455132591.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML478465181.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML149281911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML130631401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML370994221.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML340249701.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML164857911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML357395931.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML215415291.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML365433351.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML204722451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML534565861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML168181861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML276046571.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML441583521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML387920121.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML437019041.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML295684431.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML204792271.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML317627581.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML415388301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML373472221.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML325090811.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML391600301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML499487251.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML457038731.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML121094831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML289320361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML354927361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML497815101.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML164383101.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML147007921.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML421648641.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML245363941.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML303887991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML350872631.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML405279141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML131502531.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML86614891.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML391558791.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML341547201.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML299291631.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML110754521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML245135511.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML236543371.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML402002751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML62916331.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML141163981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML147191711.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML305981141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML295407331.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML148554051.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML378861241.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML121968101.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML322444221.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML286515491.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML506194141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML228503941.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML321135831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML356524031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML81876861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML245363971.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML279107941.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML205375831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML209269981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML311968021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML274013261.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML339785391.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML526450201.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML273436291.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML83955021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML152969191.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML133707131.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML135690261.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML530777561.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML222865861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML321229021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML471901291.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML320892991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML353265151.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML83996421.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML489981981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML118983511.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML373988431.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML172440791.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML318008731.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML205985211.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML508978281.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML228500931.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML204375751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML523480451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML327472511.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML293971311.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML195899881.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML263088021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML164615601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML74206721.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML81804451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML394366231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML83263761.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML312263251.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML145607221.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML204771911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML519829111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML334871171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML241412601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML341059081.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML375455461.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML406808301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML411296761.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML351080171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML458701081.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML384180381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML94290781.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML228852881.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML404942451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML304619721.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML241394291.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML454045271.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML205548791.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML249424691.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML103143911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML451023451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML228344361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML192039171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML446476891.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML181039841.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML205994731.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML387926831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML198270431.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML339772851.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML314790961.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML505936701.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML120423791.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML485813561.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML302949621.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML358927121.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML214393751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML143159031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML459912311.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML107001371.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML196490551.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML150950881.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML242525801.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML403936731.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML213567851.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML184895451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML204585171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML253511071.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML294381631.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML226240471.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML186187511.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML189171711.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML206084061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML491833871.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML205534071.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML192437991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML511439691.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML121537161.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML204854601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML192216391.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML206598971.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML205145481.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML380529111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML169967381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML295531981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML205560791.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML257580581.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML204708071.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML108600521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML140915881.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML205855051.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML444013291.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML204771901.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML144650141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML90974481.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML310473411.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML346654081.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML238873981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML203442451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML227141371.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML393511011.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML363067111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML294752251.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML312263281.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML221100091.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML388235811.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML242925781.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML284336261.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML216888291.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML107439501.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML119364581.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML398406911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML454366721.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML130257621.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML233214111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML457615761.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML215415361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML538537741.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML241385491.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML205548851.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML204637401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML204389011.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML431420231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML140723651.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML431097091.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML283406561.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML472795861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML203655611.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML214109661.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML116084311.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML192889531.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML92001131.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML318134241.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML207928531.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML203454611.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML436989901.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML162625631.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML80483371.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML223559031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML175835571.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML187450911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML457102341.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML95917351.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML279428381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML204625131.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML275021401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML279428401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML349966891.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML232212901.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML233352981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML382922671.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML233293051.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML513020031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML226388441.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML421061671.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML173608961.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML206562551.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML424344921.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML204644541.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML210141481.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML317982571.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML155334771.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML204650351.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML105116831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML388493411.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML299617601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML301379291.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML298183661.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML147380491.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML104054141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML204506471.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML110563301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML244704671.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML374271921.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML270870461.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML205011871.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML84991301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML387911581.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML336931351.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML407517831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML378221201.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML162834631.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML206025301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML452413191.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML90814751.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML204316951.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML524414241.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML291400271.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML186207861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML142175641.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML417255391.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML147329881.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML307476511.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML208603271.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML350181391.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML496681741.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML439552441.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML182097961.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML147329871.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML98168441.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML411296781.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML425529811.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML137313341.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML154867541.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML123601611.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML265598501.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML204143431.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML238811661.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML147596251.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML132395241.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML367894741.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML355445001.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML503538781.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML204822421.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML171499141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML237058681.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML417646141.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML479884051.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML265586451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML297585021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML115650371.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML244926951.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML204572331.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML356030021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML439949801.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML294384021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML80023931.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML498762721.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML117380951.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML64507401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML283470401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML122106591.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML484027061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML181889451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML354925381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML414278741.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML240964531.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML204375701.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML215540771.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML155566161.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML97710611.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Ruddy Shelduck/ML204497731.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML360074001.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML237434481.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML206581731.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML391950591.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML240730301.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML193334171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML457342101.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML297635601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML117478941.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML290583991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML204726421.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML209637601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML432192121.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML228517861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML343866221.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML310489031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML110217191.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML95809211.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML238072711.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML312246571.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML173143421.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML90005601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML328589911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML475407031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML398144971.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML207752091.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML286070971.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML78199931.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML255139811.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML234872581.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML171819441.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML112524671.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML218962871.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML477267211.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML184732001.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML137082171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML242326961.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML205047031.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML58935091.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML206053381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML171239321.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML229982171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML205103231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML342140811.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML204750381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML182868771.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML328954911.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML197663861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML357024951.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML378990631.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML166591691.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML121536241.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML162630931.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML204648971.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML192614371.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML391617821.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML205552981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Asian Green Bee-Eater/ML226795981.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML504240551.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML204731431.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML131913761.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Myna/ML236862841.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML385233991.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML131005471.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML340126391.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML254680531.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML515331111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML423068671.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML431071831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Rosefinch/ML407843571.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML276873651.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML503339231.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML321137021.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/House Crow/ML354925201.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML67159211.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML278822671.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML235692851.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML197650521.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML313529131.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML321251831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML185452951.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML204620601.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML255722651.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Rufous Treepie/ML226649361.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML206050781.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML167020641.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Pitta/ML86768921.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML518459691.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML205652381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML313462561.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML515460721.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML293079461.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML241880831.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Peacock/ML267155821.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML147287061.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML100767561.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML128612381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML204139711.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML354607171.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Waterhen/ML149268371.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML205207071.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Brown-Headed Barbet/ML232797771.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML274713551.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML390623451.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Hoopoe/ML219003011.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White Wagtail/ML422351331.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Northern Lapwing/ML398390841.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Forest Wagtail/ML378282661.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/White-Breasted Kingfisher/ML205593381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML286872851.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML211523811.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML179633421.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML507849401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML358501461.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Jungle Babbler/ML417224421.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Cattle Egret/ML261796861.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Coppersmith Barbet/ML383518661.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Red-Wattled Lapwing/ML245775401.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Tailorbird/ML219286111.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Sarus Crane/ML479357571.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Roller/ML358465381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Indian Grey Hornbill/ML400987381.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Common Kingfisher/ML382282771.jpg',\n",
       " './鸟类品种识别挑战赛训练集/training_set/Gray Wagtail/ML503910101.jpg',\n",
       " ...]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "07dd3058-80a6-451d-af4d-2900845f4540",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "25"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "class_names = ['Asian Green Bee-Eater', 'Brown-Headed Barbet', 'Cattle Egret',\n",
    "       'Common Kingfisher', 'Common Myna', 'Common Rosefinch',\n",
    "       'Common Tailorbird', 'Coppersmith Barbet', 'Forest Wagtail',\n",
    "       'Gray Wagtail', 'Hoopoe', 'House Crow', 'Indian Grey Hornbill',\n",
    "       'Indian Peacock', 'Indian Pitta', 'Indian Roller',\n",
    "       'Jungle Babbler', 'Northern Lapwing', 'Red-Wattled Lapwing',\n",
    "       'Ruddy Shelduck', 'Rufous Treepie', 'Sarus Crane', 'White Wagtail',\n",
    "       'White-Breasted Kingfisher', 'White-Breasted Waterhen']\n",
    "len(class_names)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "584f2188-cf45-4d72-abee-4dae0d362926",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "class XunFeiDataset(Dataset):\n",
    "    def __init__(self, img_path, transform=None):\n",
    "        self.img_path = img_path\n",
    "        if transform is not None:\n",
    "            self.transform = transform\n",
    "        else:\n",
    "            self.transform = None\n",
    "    \n",
    "    def __getitem__(self, index):\n",
    "        img = Image.open(self.img_path[index]).convert('RGB')\n",
    "        if self.transform is not None:\n",
    "            img = self.transform(img)\n",
    "        \n",
    "        for idx, label in enumerate(class_names):\n",
    "            if label in self.img_path[index]:\n",
    "                label = idx\n",
    "                break\n",
    "        return img, torch.from_numpy(np.array(label).astype(int))\n",
    "    \n",
    "    def __len__(self):\n",
    "        return len(self.img_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "473a6765-dd3d-4f48-8d34-ab4c32c013b4",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "class XunFeiNet(nn.Module):\n",
    "    def __init__(self):\n",
    "        super(XunFeiNet, self).__init__()\n",
    "        model = models.resnet50(True)\n",
    "        model.avgpool = nn.AdaptiveAvgPool2d(1)\n",
    "        model.fc = nn.Linear(2048, 25)\n",
    "        self.resnet = model\n",
    "    \n",
    "    def forward(self, img):\n",
    "        out = self.resnet(img)\n",
    "        return out"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "47539bef-14a7-4881-85e9-0882ff295e6a",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "def train(train_loader, model, criterion, optimizer):\n",
    "    model.train()\n",
    "    train_loss = 0.0\n",
    "    for i, (input, target) in enumerate(train_loader):\n",
    "        input = input.to(device)\n",
    "        target = target.to(device)\n",
    "\n",
    "        # compute output\n",
    "        output = model(input)\n",
    "        loss = criterion(output, target)\n",
    "\n",
    "        # compute gradient and do SGD step\n",
    "        optimizer.zero_grad()\n",
    "        loss.backward()\n",
    "        optimizer.step()\n",
    "\n",
    "        if i % 100 == 0:\n",
    "            print('Train loss', loss.item())\n",
    "            \n",
    "        train_loss += loss.item()\n",
    "    \n",
    "    return train_loss/len(train_loader)\n",
    "            \n",
    "def validate(val_loader, model, criterion):\n",
    "    model.eval()\n",
    "    \n",
    "    val_acc = 0.0\n",
    "    \n",
    "    with torch.no_grad():\n",
    "        for i, (input, target) in enumerate(val_loader):\n",
    "            input = input.to(device)\n",
    "            target = target.to(device)\n",
    "\n",
    "            # compute output\n",
    "            output = model(input)\n",
    "            loss = criterion(output, target)\n",
    "            \n",
    "            val_acc += (output.argmax(1) == target).sum().item()\n",
    "            \n",
    "    return val_acc / len(val_loader.dataset)\n",
    "\n",
    "def predict(test_loader, model, criterion):\n",
    "    model.eval()\n",
    "    val_acc = 0.0\n",
    "    \n",
    "    test_pred = []\n",
    "    with torch.no_grad():\n",
    "        for i, (input, target) in enumerate(test_loader):\n",
    "            input = input.to(device)\n",
    "            target = target.to(device)\n",
    "\n",
    "            # compute output\n",
    "            output = model(input)\n",
    "            test_pred.append(output.data.cpu().numpy())\n",
    "            \n",
    "    return np.vstack(test_pred)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "c14b410f-de94-4f52-be5b-1377c34bda4a",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "train_loader = torch.utils.data.DataLoader(\n",
    "    XunFeiDataset(train_path[:-500],\n",
    "    transforms.Compose([\n",
    "                transforms.Resize(256),\n",
    "                transforms.RandomResizedCrop(224),\n",
    "                transforms.RandomHorizontalFlip(),\n",
    "                transforms.RandomVerticalFlip(),\n",
    "                transforms.ToTensor(),\n",
    "                transforms.Normalize(mean=[0.485, 0.456, 0.406],\n",
    "                                     std=[0.229, 0.224, 0.225])\n",
    "    ])), batch_size=15, shuffle=True, num_workers=4, pin_memory=False\n",
    ")\n",
    "\n",
    "val_loader = torch.utils.data.DataLoader(\n",
    "    XunFeiDataset(train_path[-500:],\n",
    "    transforms.Compose([\n",
    "                transforms.Resize(256),\n",
    "                transforms.RandomResizedCrop(224),\n",
    "                transforms.RandomHorizontalFlip(),\n",
    "                transforms.ToTensor(),\n",
    "                transforms.Normalize(mean=[0.485, 0.456, 0.406],\n",
    "                                     std=[0.229, 0.224, 0.225])\n",
    "    ])), batch_size=30, shuffle=False, num_workers=1, pin_memory=False\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "7f7ee8cb-cfc0-4eb8-96ea-7302144ae7a4",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "model = XunFeiNet()\n",
    "model = model.to(device)\n",
    "criterion = nn.CrossEntropyLoss().cuda()\n",
    "optimizer = torch.optim.SGD(model.parameters(), 0.001)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "b2faad78-e794-4f31-8b56-1a64dbf89ccc",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train loss 3.407654047012329\n",
      "Train loss 3.1887123584747314\n",
      "Train loss 3.050079822540283\n",
      "Train loss 2.8761777877807617\n",
      "Train loss 2.5200181007385254\n",
      "Train loss 2.500518798828125\n",
      "Train loss 2.4960296154022217\n",
      "Train loss 2.230742931365967\n",
      "Train loss 1.722125768661499\n",
      "Train loss 1.8735716342926025\n",
      "Train loss 2.0721688270568848\n",
      "Train loss 1.2754912376403809\n",
      "Train loss 1.814592719078064\n",
      "2.334268528740361 0.794\n",
      "Train loss 1.5687938928604126\n",
      "Train loss 1.732311725616455\n",
      "Train loss 1.1551512479782104\n",
      "Train loss 1.2417047023773193\n",
      "Train loss 0.9111664891242981\n",
      "Train loss 1.3209998607635498\n",
      "Train loss 1.3580964803695679\n",
      "Train loss 0.9901744723320007\n",
      "Train loss 0.7112072706222534\n",
      "Train loss 0.7973817586898804\n",
      "Train loss 1.6288416385650635\n",
      "Train loss 0.7846824526786804\n",
      "Train loss 1.0067877769470215\n",
      "Train loss 1.4551539421081543\n",
      "1.1182590082681403 0.822\n",
      "Train loss 0.6152487993240356\n",
      "Train loss 0.577703595161438\n",
      "Train loss 0.9958917498588562\n",
      "Train loss 0.8031949400901794\n",
      "Train loss 1.0001251697540283\n",
      "Train loss 0.6069218516349792\n",
      "Train loss 0.632763683795929\n",
      "Train loss 0.3545137047767639\n",
      "Train loss 0.5934514999389648\n",
      "Train loss 0.5152708888053894\n",
      "Train loss 0.6697136759757996\n",
      "Train loss 1.4086244106292725\n",
      "Train loss 0.7182615995407104\n",
      "Train loss 0.6415199637413025\n",
      "0.7954814470601532 0.856\n",
      "Train loss 0.6180983185768127\n",
      "Train loss 0.6047948002815247\n",
      "Train loss 0.759618878364563\n",
      "Train loss 0.6760600209236145\n",
      "Train loss 0.666755735874176\n",
      "Train loss 0.7872560024261475\n",
      "Train loss 0.5286531448364258\n",
      "Train loss 0.8959152102470398\n",
      "Train loss 1.208556890487671\n"
     ]
    },
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m                         Traceback (most recent call last)",
      "Input \u001b[0;32mIn [16]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m _  \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m10\u001b[39m):\n\u001b[0;32m----> 2\u001b[0m     train_loss \u001b[38;5;241m=\u001b[39m \u001b[43mtrain\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtrain_loader\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmodel\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcriterion\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moptimizer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m      3\u001b[0m     val_acc  \u001b[38;5;241m=\u001b[39m validate(val_loader, model, criterion)\n\u001b[1;32m      5\u001b[0m     \u001b[38;5;28mprint\u001b[39m(train_loss, val_acc)\n",
      "Input \u001b[0;32mIn [13]\u001b[0m, in \u001b[0;36mtrain\u001b[0;34m(train_loader, model, criterion, optimizer)\u001b[0m\n\u001b[1;32m      6\u001b[0m target \u001b[38;5;241m=\u001b[39m target\u001b[38;5;241m.\u001b[39mto(device)\n\u001b[1;32m      8\u001b[0m \u001b[38;5;66;03m# compute output\u001b[39;00m\n\u001b[0;32m----> 9\u001b[0m output \u001b[38;5;241m=\u001b[39m \u001b[43mmodel\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43minput\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m     10\u001b[0m loss \u001b[38;5;241m=\u001b[39m criterion(output, target)\n\u001b[1;32m     12\u001b[0m \u001b[38;5;66;03m# compute gradient and do SGD step\u001b[39;00m\n",
      "File \u001b[0;32m~/.local/lib/python3.9/site-packages/torch/nn/modules/module.py:1130\u001b[0m, in \u001b[0;36mModule._call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m   1126\u001b[0m \u001b[38;5;66;03m# If we don't have any hooks, we want to skip the rest of the logic in\u001b[39;00m\n\u001b[1;32m   1127\u001b[0m \u001b[38;5;66;03m# this function, and just call forward.\u001b[39;00m\n\u001b[1;32m   1128\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_backward_hooks \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_forward_hooks \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_forward_pre_hooks \u001b[38;5;129;01mor\u001b[39;00m _global_backward_hooks\n\u001b[1;32m   1129\u001b[0m         \u001b[38;5;129;01mor\u001b[39;00m _global_forward_hooks \u001b[38;5;129;01mor\u001b[39;00m _global_forward_pre_hooks):\n\u001b[0;32m-> 1130\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mforward_call\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43minput\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m   1131\u001b[0m \u001b[38;5;66;03m# Do not call functions when jit is used\u001b[39;00m\n\u001b[1;32m   1132\u001b[0m full_backward_hooks, non_full_backward_hooks \u001b[38;5;241m=\u001b[39m [], []\n",
      "Input \u001b[0;32mIn [12]\u001b[0m, in \u001b[0;36mXunFeiNet.forward\u001b[0;34m(self, img)\u001b[0m\n\u001b[1;32m      9\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mforward\u001b[39m(\u001b[38;5;28mself\u001b[39m, img):\n\u001b[0;32m---> 10\u001b[0m     out \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresnet\u001b[49m\u001b[43m(\u001b[49m\u001b[43mimg\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m     11\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m out\n",
      "File \u001b[0;32m~/.local/lib/python3.9/site-packages/torch/nn/modules/module.py:1130\u001b[0m, in \u001b[0;36mModule._call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m   1126\u001b[0m \u001b[38;5;66;03m# If we don't have any hooks, we want to skip the rest of the logic in\u001b[39;00m\n\u001b[1;32m   1127\u001b[0m \u001b[38;5;66;03m# this function, and just call forward.\u001b[39;00m\n\u001b[1;32m   1128\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_backward_hooks \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_forward_hooks \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_forward_pre_hooks \u001b[38;5;129;01mor\u001b[39;00m _global_backward_hooks\n\u001b[1;32m   1129\u001b[0m         \u001b[38;5;129;01mor\u001b[39;00m _global_forward_hooks \u001b[38;5;129;01mor\u001b[39;00m _global_forward_pre_hooks):\n\u001b[0;32m-> 1130\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mforward_call\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43minput\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m   1131\u001b[0m \u001b[38;5;66;03m# Do not call functions when jit is used\u001b[39;00m\n\u001b[1;32m   1132\u001b[0m full_backward_hooks, non_full_backward_hooks \u001b[38;5;241m=\u001b[39m [], []\n",
      "File \u001b[0;32m~/.local/lib/python3.9/site-packages/torchvision/models/resnet.py:285\u001b[0m, in \u001b[0;36mResNet.forward\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m    284\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mforward\u001b[39m(\u001b[38;5;28mself\u001b[39m, x: Tensor) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Tensor:\n\u001b[0;32m--> 285\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_forward_impl\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/.local/lib/python3.9/site-packages/torchvision/models/resnet.py:276\u001b[0m, in \u001b[0;36mResNet._forward_impl\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m    274\u001b[0m x \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlayer2(x)\n\u001b[1;32m    275\u001b[0m x \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlayer3(x)\n\u001b[0;32m--> 276\u001b[0m x \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlayer4\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    278\u001b[0m x \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mavgpool(x)\n\u001b[1;32m    279\u001b[0m x \u001b[38;5;241m=\u001b[39m torch\u001b[38;5;241m.\u001b[39mflatten(x, \u001b[38;5;241m1\u001b[39m)\n",
      "File \u001b[0;32m~/.local/lib/python3.9/site-packages/torch/nn/modules/module.py:1130\u001b[0m, in \u001b[0;36mModule._call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m   1126\u001b[0m \u001b[38;5;66;03m# If we don't have any hooks, we want to skip the rest of the logic in\u001b[39;00m\n\u001b[1;32m   1127\u001b[0m \u001b[38;5;66;03m# this function, and just call forward.\u001b[39;00m\n\u001b[1;32m   1128\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_backward_hooks \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_forward_hooks \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_forward_pre_hooks \u001b[38;5;129;01mor\u001b[39;00m _global_backward_hooks\n\u001b[1;32m   1129\u001b[0m         \u001b[38;5;129;01mor\u001b[39;00m _global_forward_hooks \u001b[38;5;129;01mor\u001b[39;00m _global_forward_pre_hooks):\n\u001b[0;32m-> 1130\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mforward_call\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43minput\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m   1131\u001b[0m \u001b[38;5;66;03m# Do not call functions when jit is used\u001b[39;00m\n\u001b[1;32m   1132\u001b[0m full_backward_hooks, non_full_backward_hooks \u001b[38;5;241m=\u001b[39m [], []\n",
      "File \u001b[0;32m~/.local/lib/python3.9/site-packages/torch/nn/modules/container.py:139\u001b[0m, in \u001b[0;36mSequential.forward\u001b[0;34m(self, input)\u001b[0m\n\u001b[1;32m    137\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mforward\u001b[39m(\u001b[38;5;28mself\u001b[39m, \u001b[38;5;28minput\u001b[39m):\n\u001b[1;32m    138\u001b[0m     \u001b[38;5;28;01mfor\u001b[39;00m module \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m:\n\u001b[0;32m--> 139\u001b[0m         \u001b[38;5;28minput\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[43mmodule\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43minput\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m    140\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28minput\u001b[39m\n",
      "File \u001b[0;32m~/.local/lib/python3.9/site-packages/torch/nn/modules/module.py:1130\u001b[0m, in \u001b[0;36mModule._call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m   1126\u001b[0m \u001b[38;5;66;03m# If we don't have any hooks, we want to skip the rest of the logic in\u001b[39;00m\n\u001b[1;32m   1127\u001b[0m \u001b[38;5;66;03m# this function, and just call forward.\u001b[39;00m\n\u001b[1;32m   1128\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_backward_hooks \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_forward_hooks \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_forward_pre_hooks \u001b[38;5;129;01mor\u001b[39;00m _global_backward_hooks\n\u001b[1;32m   1129\u001b[0m         \u001b[38;5;129;01mor\u001b[39;00m _global_forward_hooks \u001b[38;5;129;01mor\u001b[39;00m _global_forward_pre_hooks):\n\u001b[0;32m-> 1130\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mforward_call\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43minput\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m   1131\u001b[0m \u001b[38;5;66;03m# Do not call functions when jit is used\u001b[39;00m\n\u001b[1;32m   1132\u001b[0m full_backward_hooks, non_full_backward_hooks \u001b[38;5;241m=\u001b[39m [], []\n",
      "File \u001b[0;32m~/.local/lib/python3.9/site-packages/torchvision/models/resnet.py:147\u001b[0m, in \u001b[0;36mBottleneck.forward\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m    144\u001b[0m identity \u001b[38;5;241m=\u001b[39m x\n\u001b[1;32m    146\u001b[0m out \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconv1(x)\n\u001b[0;32m--> 147\u001b[0m out \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mbn1\u001b[49m\u001b[43m(\u001b[49m\u001b[43mout\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    148\u001b[0m out \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mrelu(out)\n\u001b[1;32m    150\u001b[0m out \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconv2(out)\n",
      "File \u001b[0;32m~/.local/lib/python3.9/site-packages/torch/nn/modules/module.py:1130\u001b[0m, in \u001b[0;36mModule._call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m   1126\u001b[0m \u001b[38;5;66;03m# If we don't have any hooks, we want to skip the rest of the logic in\u001b[39;00m\n\u001b[1;32m   1127\u001b[0m \u001b[38;5;66;03m# this function, and just call forward.\u001b[39;00m\n\u001b[1;32m   1128\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_backward_hooks \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_forward_hooks \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_forward_pre_hooks \u001b[38;5;129;01mor\u001b[39;00m _global_backward_hooks\n\u001b[1;32m   1129\u001b[0m         \u001b[38;5;129;01mor\u001b[39;00m _global_forward_hooks \u001b[38;5;129;01mor\u001b[39;00m _global_forward_pre_hooks):\n\u001b[0;32m-> 1130\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mforward_call\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43minput\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m   1131\u001b[0m \u001b[38;5;66;03m# Do not call functions when jit is used\u001b[39;00m\n\u001b[1;32m   1132\u001b[0m full_backward_hooks, non_full_backward_hooks \u001b[38;5;241m=\u001b[39m [], []\n",
      "File \u001b[0;32m~/.local/lib/python3.9/site-packages/torch/nn/modules/batchnorm.py:148\u001b[0m, in \u001b[0;36m_BatchNorm.forward\u001b[0;34m(self, input)\u001b[0m\n\u001b[1;32m    145\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtraining \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtrack_running_stats:\n\u001b[1;32m    146\u001b[0m     \u001b[38;5;66;03m# TODO: if statement only here to tell the jit to skip emitting this when it is None\u001b[39;00m\n\u001b[1;32m    147\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mnum_batches_tracked \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:  \u001b[38;5;66;03m# type: ignore[has-type]\u001b[39;00m\n\u001b[0;32m--> 148\u001b[0m         \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mnum_batches_tracked\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43madd_\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m  \u001b[38;5;66;03m# type: ignore[has-type]\u001b[39;00m\n\u001b[1;32m    149\u001b[0m         \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmomentum \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:  \u001b[38;5;66;03m# use cumulative moving average\u001b[39;00m\n\u001b[1;32m    150\u001b[0m             exponential_average_factor \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1.0\u001b[39m \u001b[38;5;241m/\u001b[39m \u001b[38;5;28mfloat\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mnum_batches_tracked)\n",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
     ]
    }
   ],
   "source": [
    "for _  in range(10):\n",
    "    train_loss = train(train_loader, model, criterion, optimizer)\n",
    "    val_acc  = validate(val_loader, model, criterion)\n",
    "    \n",
    "    print(train_loss, val_acc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "4c342ae2-1004-41af-bbe5-0b76f4d46a41",
   "metadata": {},
   "outputs": [],
   "source": [
    "model = model.to('cpu')\n",
    "torch.save(model.state_dict(), 'model.pt')"
   ]
  },
  {
   "cell_type": "raw",
   "id": "f9b8c959-cc6c-4389-9f97-1fcced231644",
   "metadata": {},
   "source": [
    "文件夹可以组织为如下格式：\n",
    "leafs-test/\n",
    "leafs-test/model/\n",
    "leafs-test/model/model.pt\n",
    "leafs-test/.ipynb_checkpoints/\n",
    "leafs-test/.ipynb_checkpoints/run-checkpoint.py\n",
    "leafs-test/run.py\n",
    "\n",
    "tar -cvzf leafs-test.tar.gz leafs-test/\n",
    "s3cmd put leafs-test.tar.gz s3://ai-competition/你的URL/"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "81aab234-cff6-4866-99c7-ef4e13080700",
   "metadata": {},
   "source": [
    "run.py 内容如下：\n",
    "\n",
    "```python\n",
    "import os, sys, glob, argparse\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from tqdm import tqdm\n",
    "\n",
    "import cv2\n",
    "from PIL import Image\n",
    "from sklearn.model_selection import train_test_split, StratifiedKFold, KFold\n",
    "\n",
    "import torch\n",
    "torch.manual_seed(0)\n",
    "torch.backends.cudnn.deterministic = False\n",
    "torch.backends.cudnn.benchmark = True\n",
    "\n",
    "import torchvision.models as models\n",
    "import torchvision.transforms as transforms\n",
    "import torchvision.datasets as datasets\n",
    "import torch.nn as nn\n",
    "import torch.nn.functional as F\n",
    "import torch.optim as optim\n",
    "from torch.autograd import Variable\n",
    "from torch.utils.data.dataset import Dataset\n",
    "\n",
    "# Check if GPU is available\n",
    "device = torch.device(\"cpu\")\n",
    "\n",
    "class XunFeiDataset(Dataset):\n",
    "    def __init__(self, img_path, transform=None):\n",
    "        self.img_path = img_path\n",
    "        if transform is not None:\n",
    "            self.transform = transform\n",
    "        else:\n",
    "            self.transform = None\n",
    "    \n",
    "    def __getitem__(self, index):\n",
    "        img = Image.open(self.img_path[index]).convert('RGB')\n",
    "        if self.transform is not None:\n",
    "            img = self.transform(img)\n",
    "        \n",
    "        label = 0\n",
    "        \n",
    "        return img, torch.from_numpy(np.array(label).astype(int))\n",
    "    \n",
    "    def __len__(self):\n",
    "        return len(self.img_path)\n",
    "    \n",
    "class XunFeiNet(nn.Module):\n",
    "    def __init__(self):\n",
    "        super(XunFeiNet, self).__init__()\n",
    "        model = models.resnet50(False)\n",
    "        model.avgpool = nn.AdaptiveAvgPool2d(1)\n",
    "        model.fc = nn.Linear(2048, 25)\n",
    "        self.resnet = model\n",
    "    \n",
    "    def forward(self, img):\n",
    "        out = self.resnet(img)\n",
    "        return out\n",
    "    \n",
    "def predict(test_loader, model):\n",
    "    model.eval()    \n",
    "    test_pred = []\n",
    "    with torch.no_grad():\n",
    "        for i, (input, target) in enumerate(test_loader):\n",
    "            input = input.to(device)\n",
    "            target = target.to(device)\n",
    "            output = model(input)\n",
    "            test_pred.append(output.data.cpu().numpy())\n",
    "            \n",
    "    return np.vstack(test_pred)\n",
    "\n",
    "\n",
    "test_path = glob.glob('/work/data/birds-test-dataset/*')\n",
    "test_path.sort()\n",
    "\n",
    "test_loader = torch.utils.data.DataLoader(\n",
    "    XunFeiDataset(test_path[:],\n",
    "    transforms.Compose([\n",
    "                transforms.Resize((224, 224)),\n",
    "                # transforms.RandomResizedCrop(224),\n",
    "                # transforms.RandomHorizontalFlip(),\n",
    "                transforms.ToTensor(),\n",
    "                transforms.Normalize(mean=[0.485, 0.456, 0.406],\n",
    "                                     std=[0.229, 0.224, 0.225])\n",
    "    ])), batch_size=30, shuffle=False, num_workers=1, pin_memory=False\n",
    ")\n",
    "model = XunFeiNet()\n",
    "model.load_state_dict(torch.load('./model/model.pt'))\n",
    "\n",
    "test_pred = predict(test_loader, model)\n",
    "test_pred = test_pred.argmax(1)\n",
    "# class_names = np.array(['Asian Green Bee-Eater', 'Brown-Headed Barbet', 'Cattle Egret',\n",
    "#        'Common Kingfisher', 'Common Myna', 'Common Rosefinch',\n",
    "#        'Common Tailorbird', 'Coppersmith Barbet', 'Forest Wagtail',\n",
    "#        'Gray Wagtail', 'Hoopoe', 'House Crow', 'Indian Grey Hornbill',\n",
    "#        'Indian Peacock', 'Indian Pitta', 'Indian Roller',\n",
    "#        'Jungle Babbler', 'Northern Lapwing', 'Red-Wattled Lapwing',\n",
    "#        'Ruddy Shelduck', 'Rufous Treepie', 'Sarus Crane', 'White Wagtail',\n",
    "#        'White-Breasted Kingfisher', 'White-Breasted Waterhen'])\n",
    "# test_pred = class_names[test_pred]\n",
    "\n",
    "pd.DataFrame({\n",
    "    'imageID': [x.split('/')[-1] for x in test_path],\n",
    "    'label': test_pred\n",
    "}).to_csv('/work/output/result.csv', index=None)\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ea00dec7-f842-459a-b2c6-e108dc9b522b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "12b893d0-d22e-401a-b39a-4810c7ec7e6a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3.10"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.10"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {},
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
